package user.main;

import java.io.BufferedReader;
import java.io.InputStreamReader;

import commonfunctions.Matrix;

import fileparsing.ReadProbabilities;
import filewriting.MatlabMatrixWriter;

public class RunConvertToMatlab 
{
	public static void main(String[] args)
	{
		try 
		{
			System.out.println("Converts the weights to a matrix in Matlab.");
			System.out.println();
	
	    	System.out.println("What directory will the data be read from?");
	    	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	    	String dirName = br.readLine();
	    	Matrix weights = ReadProbabilities.probabilityMatrix(dirName);
	    	
	    	TrackerThread threads = new TrackerThread();
	    	
	    	threads.addThread(MatlabMatrixWriter.startWriting(weights, dirName));
	    	
	    	threads.run();
		}
		catch (Exception e)
		{
			System.out.println("Problem reading.");
			e.printStackTrace();
		}
	}
}
